<!--
Version 0.1
SEMF - Web Desiging Framework for Sport Event Managment
Copyright (C) 2006, SEMF Developers

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="component">
		<!-- just to group all them -->
		<properties>
			<xsl:for-each select="property">
				<tab>
					<xsl:attribute name="title">
						<xsl:value-of select="@key" />
					</xsl:attribute>
					<xsl:if test="@key='Apearance' or @key='DataBinding' or @key='Links'">
						<table>
							<tbody>
								<xsl:for-each select="property">
									<tr>
										<td style="font-size:12px">
											<xsl:value-of select="@key" />
										</td>
										<td>
											<input style="width:220px" type="text">
												<xsl:attribute name="id">
													<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
												</xsl:attribute>
												<xsl:attribute name="value">
													<!-- value is no longer an attribute 
													<xsl:value-of select="@value" /> -->
													<xsl:value-of select="translate(., '\\','')"/>
												</xsl:attribute>
												<xsl:attribute name="onchange">
													<xsl:text>SEMF.pageDesigner.changeProperty(</xsl:text>
													<xsl:text>'</xsl:text><xsl:value-of select="@key" />
													<xsl:text>', </xsl:text>
														<xsl:text>document.getElementById('</xsl:text>
														<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
														<xsl:text>').value</xsl:text>
													<xsl:text>)</xsl:text>
												</xsl:attribute>
											</input>
										</td>
										<xsl:if test="contains(@key,'Color')">
										<td>
											<img title="Click to add Color.." 
											 style="cursor:pointer"
											 src="images/properties/sel.gif">
												<xsl:attribute name="onClick">
													<xsl:text>javascript:TCP.popup(</xsl:text> 
														<xsl:text>document.getElementById('</xsl:text>
														<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
														<xsl:text>'), 1</xsl:text>
													<xsl:text>)</xsl:text>
												</xsl:attribute>
											</img>
										</td>
										</xsl:if>
										<xsl:if test="contains(@key,'Image')">
										<td>
											<img title="Click to add new image.." style="cursor:pointer"
											 src="images/properties/window-new.png">
												<xsl:attribute name="onClick">
													<xsl:text>SEMF.pageDesigner.showStore(</xsl:text>
													<xsl:text>'</xsl:text><xsl:value-of select="@key" />
													<xsl:text>', </xsl:text> 
														<xsl:text>document.getElementById('</xsl:text>
														<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
														<xsl:text>').value, 0</xsl:text>
													<xsl:text>)</xsl:text>
												</xsl:attribute>
											</img>
										</td>
										</xsl:if>	
										<xsl:if test="@key='Directory'">
										<td>
											<img title="Click to add new image.." style="cursor:pointer"
											 src="images/properties/window-new.png">
												<xsl:attribute name="onClick">
													<xsl:text>SEMF.pageDesigner.showStore(</xsl:text>
													<xsl:text>'</xsl:text><xsl:value-of select="@key" />
													<xsl:text>', </xsl:text> 
														<xsl:text>document.getElementById('</xsl:text>
														<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
														<xsl:text>').value, 1</xsl:text>
													<xsl:text>)</xsl:text>
												</xsl:attribute>
											</img>
										</td>
										</xsl:if>	
									</tr>
								</xsl:for-each>
							</tbody>
						</table>
					</xsl:if>
					<xsl:if test="@key='Action Handlers'">
							<xsl:for-each select="property">
								<label><xsl:value-of select="@key" />
									<xsl:text> </xsl:text>
									<img style="cursor:pointer"
									 src="images/properties/window-new.png">
										<xsl:attribute name="onClick">
											<xsl:text>SEMF.pageDesigner.showPropertyExpander(
											</xsl:text> 1 /* the type 1 */, 
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', </xsl:text> 
								<xsl:text>document.getElementById('</xsl:text>
								<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
								<xsl:text>').innerHTML</xsl:text>
											<xsl:text>)</xsl:text>
										</xsl:attribute>
									</img>
									
									<textarea style="width:98%; height:50px" name="textarea">
										<xsl:attribute name="id">
											<xsl:value-of select="@key" /><xsl:text>_TEXT</xsl:text>
										</xsl:attribute>
										<xsl:attribute name="onChange">
											<xsl:text>SEMF.pageDesigner.changeProperty(</xsl:text>
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', this.value</xsl:text> 
											<xsl:text>)</xsl:text>
										</xsl:attribute>
										<!-- value is no longer an attribute 
										<xsl:value-of select="@value" /> -->
										<xsl:value-of select="translate(., '\\','')"/>
									</textarea>
								</label>
							</xsl:for-each>
					</xsl:if>
					<xsl:if test="@key='Declarations'">
							<xsl:for-each select="property">
								<label>
									<xsl:text>Explicit Declarations of the variables:</xsl:text>
									<textarea style="width:98%; height:100px" name="textarea">
										<xsl:attribute name="onChange">
											<xsl:text>SEMF.pageDesigner.changeProperty(</xsl:text>
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', this.value</xsl:text> 
											<xsl:text>)</xsl:text>
										</xsl:attribute>
										<!-- value is no longer an attribute 
										<xsl:value-of select="@value" /> -->
										<xsl:value-of select="translate(., '\\','')"/>
									</textarea>
								</label>
							</xsl:for-each>
					</xsl:if>
					<xsl:if test="@key='Validation'">
							<xsl:for-each select="property">
								<label>
									<p><xsl:text>The set of expressions to test the component is valid and </xsl:text>
									<xsl:text>the corrosponding error messages if it is not valid:</xsl:text></p>
									<p><b><xsl:text>E.g. </xsl:text></b>
									<xsl:text>this.value != &quot;&quot; &lt;&gt; Value should not be empty;</xsl:text></p>
									<textarea style="width:98%; height:100px" name="textarea">
										<xsl:attribute name="onChange">
											<xsl:text>SEMF.pageDesigner.changeProperty(</xsl:text>
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', this.value</xsl:text> 
											<xsl:text>)</xsl:text>
										</xsl:attribute>
										<!-- value is no longer an attribute 
										<xsl:value-of select="@value" /> -->
										<xsl:value-of select="translate(., '\\','')"/>
									</textarea>
								</label>
							</xsl:for-each>
					</xsl:if>
					<xsl:if test="@key='Administration'">
							<xsl:for-each select="property">
								<label>
									<p><xsl:text>The expression to control the administration of the control: </xsl:text></p>
									<p><b><xsl:text>E.g. </xsl:text></b>
									<xsl:text>this_user.type == this_module.module_admin</xsl:text></p>
									<textarea style="width:98%; height:100px" name="textarea">
										<xsl:attribute name="onChange">
											<xsl:text>SEMF.pageDesigner.changeProperty(</xsl:text>
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', this.value</xsl:text> 
											<xsl:text>)</xsl:text>
										</xsl:attribute>
										<!-- value is no longer an attribute 
										<xsl:value-of select="@value" /> -->
										<xsl:value-of select="translate(., '\\','')"/>
									</textarea>
								</label>
							</xsl:for-each>
					</xsl:if>
					<xsl:if test="@key='HTMLText'">
							<xsl:for-each select="property">
<!-- mark the start of the HTML Rich Text Box Controller -->
								<xsl:text>Text </xsl:text>
									<img style="cursor:pointer"
									 src="images/properties/window-new.png">
										<xsl:attribute name="onClick">
											<xsl:text>SEMF.pageDesigner.showPropertyExpander(
											</xsl:text> 2 /* the type 2 */, 
											<xsl:text>'</xsl:text><xsl:value-of select="@key" />
											<xsl:text>', '</xsl:text> 
											<xsl:text>')</xsl:text>
										</xsl:attribute>
									</img>
								<span>
								<iframe style="border:none; height:270px; overflow:visible" 
									width="110%" src="RichText.html">
								</iframe>
								</span>
								<span id="hiddenRichText" style="visibility:hidden; ">
									<xsl:value-of select="."/>
								</span>
<!-- mark the end of the HTML Rich Text Box Controller -->
							</xsl:for-each>						
					</xsl:if>
				</tab>
			</xsl:for-each>
		</properties>
</xsl:template>
</xsl:stylesheet>